home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / biblio / bibtex / contrib / namunsrt.bst < prev    next >
Text File  |  1992-07-19  |  18KB  |  950 lines

  1. % BibTeX standard bibliography style `unsrt'
  2.         % version 0.99a for BibTeX versions 0.99a or later, LaTeX version 2.09.
  3.         % Copyright (C) 1985, all rights reserved.
  4.         % Copying of this file is authorized only if either
  5.         % (1) you make absolutely no changes to your copy, including name, or
  6.         % (2) if you do make changes, you name it something other than
  7.         % btxbst.doc, plain.bst, unsrt.bst, alpha.bst, and abbrv.bst.
  8.         % This restriction helps ensure that all standard styles are identical.
  9.         % The file btxbst.doc has the documentation for this style.
  10.  
  11. ENTRY
  12.   { address
  13.     author
  14.     booktitle
  15.     chapter
  16.     edition
  17.     editor
  18.     howpublished
  19.     institution
  20.     journal
  21.     key
  22.     month
  23.     nam
  24.     note
  25.     number
  26.     organization
  27.     pages
  28.     publisher
  29.     school
  30.     series
  31.     title
  32.     type
  33.     volume
  34.     year
  35.   }
  36.   {}
  37.   { label }
  38.  
  39. INTEGERS { output.state before.all mid.sentence after.sentence after.block }
  40.  
  41. FUNCTION {init.state.consts}
  42. { #0 'before.all :=
  43.   #1 'mid.sentence :=
  44.   #2 'after.sentence :=
  45.   #3 'after.block :=
  46. }
  47.  
  48. STRINGS { s t }
  49.  
  50. FUNCTION {output.nonnull}
  51. { 's :=
  52.   output.state mid.sentence =
  53.     { ", " * write$ }
  54.     { output.state after.block =
  55.         { add.period$ write$
  56.           newline$
  57.           "\newblock " write$
  58.         }
  59.         { output.state before.all =
  60.             'write$
  61.             { add.period$ " " * write$ }
  62.           if$
  63.         }
  64.       if$
  65.       mid.sentence 'output.state :=
  66.     }
  67.   if$
  68.   s
  69. }
  70.  
  71. FUNCTION {output}
  72. { duplicate$ empty$
  73.     'pop$
  74.     'output.nonnull
  75.   if$
  76. }
  77.  
  78. FUNCTION {output.check}
  79. { 't :=
  80.   duplicate$ empty$
  81.     { pop$ "empty " t * " in " * cite$ * warning$ }
  82.     'output.nonnull
  83.   if$
  84. }
  85.  
  86. FUNCTION {output.bibitem}
  87. { newline$
  88.   "\bibitem[" write$
  89.   nam write$
  90.   "]{" write$
  91.   cite$ write$
  92.   "}" write$
  93.   newline$
  94.   ""
  95.   before.all 'output.state :=
  96. }
  97.  
  98. FUNCTION {fin.entry}
  99. { add.period$
  100.   write$
  101.   newline$
  102. }
  103.  
  104. FUNCTION {new.block}
  105. { output.state before.all =
  106.     'skip$
  107.     { after.block 'output.state := }
  108.   if$
  109. }
  110.  
  111. FUNCTION {new.sentence}
  112. { output.state after.block =
  113.     'skip$
  114.     { output.state before.all =
  115.         'skip$
  116.         { after.sentence 'output.state := }
  117.       if$
  118.     }
  119.   if$
  120. }
  121.  
  122. FUNCTION {not}
  123. {   { #0 }
  124.     { #1 }
  125.   if$
  126. }
  127.  
  128. FUNCTION {and}
  129. {   'skip$
  130.     { pop$ #0 }
  131.   if$
  132. }
  133.  
  134. FUNCTION {or}
  135. {   { pop$ #1 }
  136.     'skip$
  137.   if$
  138. }
  139.  
  140. FUNCTION {new.block.checka}
  141. { empty$
  142.     'skip$
  143.     'new.block
  144.   if$
  145. }
  146.  
  147. FUNCTION {new.block.checkb}
  148. { empty$
  149.   swap$ empty$
  150.   and
  151.     'skip$
  152.     'new.block
  153.   if$
  154. }
  155.  
  156. FUNCTION {new.sentence.checka}
  157. { empty$
  158.     'skip$
  159.     'new.sentence
  160.   if$
  161. }
  162.  
  163. FUNCTION {new.sentence.checkb}
  164. { empty$
  165.   swap$ empty$
  166.   and
  167.     'skip$
  168.     'new.sentence
  169.   if$
  170. }
  171.  
  172. FUNCTION {field.or.null}
  173. { duplicate$ empty$
  174.     { pop$ "" }
  175.     'skip$
  176.   if$
  177. }
  178.  
  179. FUNCTION {emphasize}
  180. { duplicate$ empty$
  181.     { pop$ "" }
  182.     { "{\em " swap$ * "}" * }
  183.   if$
  184. }
  185.  
  186. INTEGERS { nameptr namesleft numnames }
  187.  
  188. FUNCTION {format.names}
  189. { 's :=
  190.   #1 'nameptr :=
  191.   s num.names$ 'numnames :=
  192.   numnames 'namesleft :=
  193.     { namesleft #0 > }
  194.     { s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ 't :=
  195.       nameptr #1 >
  196.         { namesleft #1 >
  197.             { ", " * t * }
  198.             { numnames #2 >
  199.                 { "," * }
  200.                 'skip$
  201.               if$
  202.               t "others" =
  203.                 { " et~al." * }
  204.                 { " and " * t * }
  205.               if$
  206.             }
  207.           if$
  208.         }
  209.         't
  210.       if$
  211.       nameptr #1 + 'nameptr :=
  212.       namesleft #1 - 'namesleft :=
  213.     }
  214.   while$
  215. }
  216.  
  217. FUNCTION {format.authors}
  218. { author empty$
  219.     { "" }
  220.     { author format.names }
  221.   if$
  222. }
  223.  
  224. FUNCTION {format.editors}
  225. { editor empty$
  226.     { "" }
  227.     { editor format.names
  228.       editor num.names$ #1 >
  229.         { ", editors" * }
  230.         { ", editor" * }
  231.       if$
  232.     }
  233.   if$
  234. }
  235.  
  236. FUNCTION {format.title}
  237. { title empty$
  238.     { "" }
  239.     { title "t" change.case$ }
  240.   if$
  241. }
  242.  
  243. FUNCTION {n.dashify}
  244. { 't :=
  245.   ""
  246.     { t empty$ not }
  247.     { t #1 #1 substring$ "-" =
  248.         { t #1 #2 substring$ "--" = not
  249.             { "--" *
  250.               t #2 global.max$ substring$ 't :=
  251.             }
  252.             {   { t #1 #1 substring$ "-" = }
  253.                 { "-" *
  254.                   t #2 global.max$ substring$ 't :=
  255.                 }
  256.               while$
  257.             }
  258.           if$
  259.         }
  260.         { t #1 #1 substring$ *
  261.           t #2 global.max$ substring$ 't :=
  262.         }
  263.       if$
  264.     }
  265.   while$
  266. }
  267.  
  268. FUNCTION {format.date}
  269. { year empty$
  270.     { month empty$
  271.         { "" }
  272.         { "there's a month but no year in " cite$ * warning$
  273.           month
  274.         }
  275.       if$
  276.     }
  277.     { month empty$
  278.         'year
  279.         { month " " * year * }
  280.       if$
  281.     }
  282.   if$
  283. }
  284.  
  285. FUNCTION {format.btitle}
  286. { title emphasize
  287. }
  288.  
  289. FUNCTION {tie.or.space.connect}
  290. { duplicate$ text.length$ #3 <
  291.     { "~" }
  292.     { " " }
  293.   if$
  294.   swap$ * *
  295. }
  296.  
  297. FUNCTION {either.or.check}
  298. { empty$
  299.     'pop$
  300.     { "can't use both " swap$ * " fields in " * cite$ * warning$ }
  301.   if$
  302. }
  303.  
  304. FUNCTION {format.bvolume}
  305. { volume empty$
  306.     { "" }
  307.     { "volume" volume tie.or.space.connect
  308.       series empty$
  309.         'skip$
  310.         { " of " * series emphasize * }
  311.       if$
  312.       "volume and number" number either.or.check
  313.     }
  314.   if$
  315. }
  316.  
  317. FUNCTION {format.number.series}
  318. { volume empty$
  319.     { number empty$
  320.         { series field.or.null }
  321.         { output.state mid.sentence =
  322.             { "number" }
  323.             { "Number" }
  324.           if$
  325.           number tie.or.space.connect
  326.           series empty$
  327.             { "there's a number but no series in " cite$ * warning$ }
  328.             { " in " * series * }
  329.           if$
  330.         }
  331.       if$
  332.     }
  333.     { "" }
  334.   if$
  335. }
  336.  
  337. FUNCTION {format.edition}
  338. { edition empty$
  339.     { "" }
  340.     { output.state mid.sentence =
  341.         { edition "l" change.case$ " edition" * }
  342.         { edition "t" change.case$ " edition" * }
  343.       if$
  344.     }
  345.   if$
  346. }
  347.  
  348. INTEGERS { multiresult }
  349.  
  350. FUNCTION {multi.page.check}
  351. { 't :=
  352.   #0 'multiresult :=
  353.     { multiresult not
  354.       t empty$ not
  355.       and
  356.     }
  357.     { t #1 #1 substring$
  358.       duplicate$ "-" =
  359.       swap$ duplicate$ "," =
  360.       swap$ "+" =
  361.       or or
  362.         { #1 'multiresult := }
  363.         { t #2 global.max$ substring$ 't := }
  364.       if$
  365.     }
  366.   while$
  367.   multiresult
  368. }
  369.  
  370. FUNCTION {format.pages}
  371. { pages empty$
  372.     { "" }
  373.     { pages multi.page.check
  374.         { "pages" pages n.dashify tie.or.space.connect }
  375.         { "page" pages tie.or.space.connect }
  376.       if$
  377.     }
  378.   if$
  379. }
  380.  
  381. FUNCTION {format.vol.num.pages}
  382. { volume field.or.null
  383.   number empty$
  384.     'skip$
  385.     { "(" number * ")" * *
  386.       volume empty$
  387.         { "there's a number but no volume in " cite$ * warning$ }
  388.         'skip$
  389.       if$
  390.     }
  391.   if$
  392.   pages empty$
  393.     'skip$
  394.     { duplicate$ empty$
  395.         { pop$ format.pages }
  396.         { ":" * pages n.dashify * }
  397.       if$
  398.     }
  399.   if$
  400. }
  401.  
  402. FUNCTION {format.chapter.pages}
  403. { chapter empty$
  404.     'format.pages
  405.     { type empty$
  406.         { "chapter" }
  407.         { type "l" change.case$ }
  408.       if$
  409.       chapter tie.or.space.connect
  410.       pages empty$
  411.         'skip$
  412.         { ", " * format.pages * }
  413.       if$
  414.     }
  415.   if$
  416. }
  417.  
  418. FUNCTION {format.in.ed.booktitle}
  419. { booktitle empty$
  420.     { "" }
  421.     { editor empty$
  422.         { "In " booktitle emphasize * }
  423.         { "In " format.editors * ", " * booktitle emphasize * }
  424.       if$
  425.     }
  426.   if$
  427. }
  428.  
  429. FUNCTION {empty.misc.check}
  430. { author empty$ title empty$ howpublished empty$
  431.   month empty$ year empty$ note empty$
  432.   and and and and and
  433.     { "all relevant fields are empty in " cite$ * warning$ }
  434.     'skip$
  435.   if$
  436. }
  437.  
  438. FUNCTION {format.thesis.type}
  439. { type empty$
  440.     'skip$
  441.     { pop$
  442.       type "t" change.case$
  443.     }
  444.   if$
  445. }
  446.  
  447. FUNCTION {format.tr.number}
  448. { type empty$
  449.     { "NAM" }
  450.     'type
  451.   if$
  452.   number empty$
  453.     { "t" change.case$ }
  454.     { number tie.or.space.connect }
  455.   if$
  456. }
  457.  
  458. FUNCTION {format.article.crossref}
  459. { key empty$
  460.     { journal empty$
  461.         { "need key or journal for " cite$ * " to crossref " * crossref *
  462.           warning$
  463.           ""
  464.         }
  465.         { "In {\em " journal * "\/}" * }
  466.       if$
  467.     }
  468.     { "In " key * }
  469.   if$
  470.   " \cite{" * crossref * "}" *
  471. }
  472.  
  473. FUNCTION {format.crossref.editor}
  474. { editor #1 "{vv~}{ll}" format.name$
  475.   editor num.names$ duplicate$
  476.   #2 >
  477.     { pop$ " et~al." * }
  478.     { #2 <
  479.         'skip$
  480.         { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
  481.             { " et~al." * }
  482.             { " and " * editor #2 "{vv~}{ll}" format.name$ * }
  483.           if$
  484.         }
  485.       if$
  486.     }
  487.   if$
  488. }
  489.  
  490. FUNCTION {format.book.crossref}
  491. { volume empty$
  492.     { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
  493.       "In "
  494.     }
  495.     { "Volume" volume tie.or.space.connect
  496.       " of " *
  497.     }
  498.   if$
  499.   editor empty$
  500.   editor field.or.null author field.or.null =
  501.   or
  502.     { key empty$
  503.         { series empty$
  504.             { "need editor, key, or series for " cite$ * " to crossref " *
  505.               crossref * warning$
  506.               "" *
  507.             }
  508.             { "{\em " * series * "\/}" * }
  509.           if$
  510.         }
  511.         { key * }
  512.       if$
  513.     }
  514.     { format.crossref.editor * }
  515.   if$
  516.   " \cite{" * crossref * "}" *
  517. }
  518.  
  519. FUNCTION {format.incoll.inproc.crossref}
  520. { editor empty$
  521.   editor field.or.null author field.or.null =
  522.   or
  523.     { key empty$
  524.         { booktitle empty$
  525.             { "need editor, key, or booktitle for " cite$ * " to crossref " *
  526.               crossref * warning$
  527.               ""
  528.             }
  529.             { "In {\em " booktitle * "\/}" * }
  530.           if$
  531.         }
  532.         { "In " key * }
  533.       if$
  534.     }
  535.     { "In " format.crossref.editor * }
  536.   if$
  537.   " \cite{" * crossref * "}" *
  538. }
  539.  
  540. FUNCTION {article}
  541. { output.bibitem
  542.   format.authors "author" output.check
  543.   new.block
  544.   format.title "title" output.check
  545.   new.block
  546.   crossref missing$
  547.     { journal emphasize "journal" output.check
  548.       format.vol.num.pages output
  549.       format.date "year" output.check
  550.     }
  551.     { format.article.crossref output.nonnull
  552.       format.pages output
  553.     }
  554.   if$
  555.   new.block
  556.   note output
  557.   fin.entry
  558. }
  559.  
  560. FUNCTION {book}
  561. { output.bibitem
  562.   author empty$
  563.     { format.editors "author and editor" output.check }
  564.     { format.authors output.nonnull
  565.       crossref missing$
  566.         { "author and editor" editor either.or.check }
  567.         'skip$
  568.       if$
  569.     }
  570.   if$
  571.   new.block
  572.   format.btitle "title" output.check
  573.   crossref missing$
  574.     { format.bvolume output
  575.       new.block
  576.       format.number.series output
  577.       new.sentence
  578.       publisher "publisher" output.check
  579.       address output
  580.     }
  581.     { new.block
  582.       format.book.crossref output.nonnull
  583.     }
  584.   if$
  585.   format.edition output
  586.   format.date "year" output.check
  587.   new.block
  588.   note output
  589.   fin.entry
  590. }
  591.  
  592. FUNCTION {booklet}
  593. { output.bibitem
  594.   format.authors output
  595.   new.block
  596.   format.title "title" output.check
  597.   howpublished address new.block.checkb
  598.   howpublished output
  599.   address output
  600.   format.date output
  601.   new.block
  602.   note output
  603.   fin.entry
  604. }
  605.  
  606. FUNCTION {inbook}
  607. { output.bibitem
  608.   author empty$
  609.     { format.editors "author and editor" output.check }
  610.     { format.authors output.nonnull
  611.       crossref missing$
  612.         { "author and editor" editor either.or.check }
  613.         'skip$
  614.       if$
  615.     }
  616.   if$
  617.   new.block
  618.   format.btitle "title" output.check
  619.   crossref missing$
  620.     { format.bvolume output
  621.       format.chapter.pages "chapter and pages" output.check
  622.       new.block
  623.       format.number.series output
  624.       new.sentence
  625.       publisher "publisher" output.check
  626.       address output
  627.     }
  628.     { format.chapter.pages "chapter and pages" output.check
  629.       new.block
  630.       format.book.crossref output.nonnull
  631.     }
  632.   if$
  633.   format.edition output
  634.   format.date "year" output.check
  635.   new.block
  636.   note output
  637.   fin.entry
  638. }
  639.  
  640. FUNCTION {incollection}
  641. { output.bibitem
  642.   format.authors "author" output.check
  643.   new.block
  644.   format.title "title" output.check
  645.   new.block
  646.   crossref missing$
  647.     { format.in.ed.booktitle "booktitle" output.check
  648.       format.bvolume output
  649.       format.number.series output
  650.       format.chapter.pages output
  651.       new.sentence
  652.       publisher "publisher" output.check
  653.       address output
  654.       format.edition output
  655.       format.date "year" output.check
  656.     }
  657.     { format.incoll.inproc.crossref output.nonnull
  658.       format.chapter.pages output
  659.     }
  660.   if$
  661.   new.block
  662.   note output
  663.   fin.entry
  664. }
  665.  
  666. FUNCTION {inproceedings}
  667. { output.bibitem
  668.   format.authors "author" output.check
  669.   new.block
  670.   format.title "title" output.check
  671.   new.block
  672.   crossref missing$
  673.     { format.in.ed.booktitle "booktitle" output.check
  674.       format.bvolume output
  675.       format.number.series output
  676.       format.pages output
  677.       address empty$
  678.         { organization publisher new.sentence.checkb
  679.           organization output
  680.           publisher output
  681.           format.date "year" output.check
  682.         }
  683.         { address output.nonnull
  684.           format.date "year" output.check
  685.           new.sentence
  686.           organization output
  687.           publisher output
  688.         }
  689.       if$
  690.     }
  691.     { format.incoll.inproc.crossref output.nonnull
  692.       format.pages output
  693.     }
  694.   if$
  695.   new.block
  696.   note output
  697.   fin.entry
  698. }
  699.  
  700. FUNCTION {conference} { inproceedings }
  701.  
  702. FUNCTION {manual}
  703. { output.bibitem
  704.   author empty$
  705.     { organization empty$
  706.         'skip$
  707.         { organization output.nonnull
  708.           address output
  709.         }
  710.       if$
  711.     }
  712.     { format.authors output.nonnull }
  713.   if$
  714.   new.block
  715.   format.btitle "title" output.check
  716.   author empty$
  717.     { organization empty$
  718.         { address new.block.checka
  719.           address output
  720.         }
  721.         'skip$
  722.       if$
  723.     }
  724.     { organization address new.block.checkb
  725.       organization output
  726.       address output
  727.     }
  728.   if$
  729.   format.edition output
  730.   format.date output
  731.   new.block
  732.   note output
  733.   fin.entry
  734. }
  735.  
  736. FUNCTION {mastersthesis}
  737. { output.bibitem
  738.   format.authors "author" output.check
  739.   new.block
  740.   format.title "title" output.check
  741.   new.block
  742.   "Master's thesis" format.thesis.type output.nonnull
  743.   school "school" output.check
  744.   address output
  745.   format.date "year" output.check
  746.   new.block
  747.   note output
  748.   fin.entry
  749. }
  750.  
  751. FUNCTION {misc}
  752. { output.bibitem
  753.   format.authors output
  754.   title howpublished new.block.checkb
  755.   format.title output
  756.   howpublished new.block.checka
  757.   howpublished output
  758.   format.date output
  759.   new.block
  760.   note output
  761.   fin.entry
  762.   empty.misc.check
  763. }
  764.  
  765. FUNCTION {phdthesis}
  766. { output.bibitem
  767.   format.authors "author" output.check
  768.   new.block
  769.   format.btitle "title" output.check
  770.   new.block
  771.   "PhD thesis" format.thesis.type output.nonnull
  772.   school "school" output.check
  773.   address output
  774.   format.date "year" output.check
  775.   new.block
  776.   note output
  777.   fin.entry
  778. }
  779.  
  780. FUNCTION {proceedings}
  781. { output.bibitem
  782.   editor empty$
  783.     { organization output }
  784.     { format.editors output.nonnull }
  785.   if$
  786.   new.block
  787.   format.btitle "title" output.check
  788.   format.bvolume output
  789.   format.number.series output
  790.   address empty$
  791.     { editor empty$
  792.         { publisher new.sentence.checka }
  793.         { organization publisher new.sentence.checkb
  794.           organization output
  795.         }
  796.       if$
  797.       publisher output
  798.       format.date "year" output.check
  799.     }
  800.     { address output.nonnull
  801.       format.date "year" output.check
  802.       new.sentence
  803.       editor empty$
  804.         'skip$
  805.         { organization output }
  806.       if$
  807.       publisher output
  808.     }
  809.   if$
  810.   new.block
  811.   note output
  812.   fin.entry
  813. }
  814.  
  815. FUNCTION {techreport}
  816. { output.bibitem
  817.   format.authors "author" output.check
  818.   new.block
  819.   format.title "title" output.check
  820.   new.block
  821.   note output
  822.   fin.entry
  823. }
  824.  
  825. FUNCTION {unpublished}
  826. { output.bibitem
  827.   format.authors "author" output.check
  828.   new.block
  829.   format.title "title" output.check
  830.   new.block
  831.   note "note" output.check
  832.   format.date output
  833.   fin.entry
  834. }
  835.  
  836. FUNCTION {default.type} { misc }
  837.  
  838. MACRO {jan} {"January"}
  839.  
  840. MACRO {feb} {"February"}
  841.  
  842. MACRO {mar} {"March"}
  843.  
  844. MACRO {apr} {"April"}
  845.  
  846. MACRO {may} {"May"}
  847.  
  848. MACRO {jun} {"June"}
  849.  
  850. MACRO {jul} {"July"}
  851.  
  852. MACRO {aug} {"August"}
  853.  
  854. MACRO {sep} {"September"}
  855.  
  856. MACRO {oct} {"October"}
  857.  
  858. MACRO {nov} {"November"}
  859.  
  860. MACRO {dec} {"December"}
  861.  
  862. MACRO {acmcs} {"ACM Computing Surveys"}
  863.  
  864. MACRO {acta} {"Acta Informatica"}
  865.  
  866. MACRO {cacm} {"Communications of the ACM"}
  867.  
  868. MACRO {ibmjrd} {"IBM Journal of Research and Development"}
  869.  
  870. MACRO {ibmsj} {"IBM Systems Journal"}
  871.  
  872. MACRO {ieeese} {"IEEE Transactions on Software Engineering"}
  873.  
  874. MACRO {ieeetc} {"IEEE Transactions on Computers"}
  875.  
  876. MACRO {ieeetcad}
  877.  {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"}
  878.  
  879. MACRO {ipl} {"Information Processing Letters"}
  880.  
  881. MACRO {jacm} {"Journal of the ACM"}
  882.  
  883. MACRO {jcss} {"Journal of Computer and System Sciences"}
  884.  
  885. MACRO {scp} {"Science of Computer Programming"}
  886.  
  887. MACRO {sicomp} {"SIAM Journal on Computing"}
  888.  
  889. MACRO {tocs} {"ACM Transactions on Computer Systems"}
  890.  
  891. MACRO {tods} {"ACM Transactions on Database Systems"}
  892.  
  893. MACRO {tog} {"ACM Transactions on Graphics"}
  894.  
  895. MACRO {toms} {"ACM Transactions on Mathematical Software"}
  896.  
  897. MACRO {toois} {"ACM Transactions on Office Information Systems"}
  898.  
  899. MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"}
  900.  
  901. MACRO {tcs} {"Theoretical Computer Science"}
  902.  
  903. READ
  904.  
  905. STRINGS { longest.label }
  906.  
  907. INTEGERS { number.label longest.label.width }
  908.  
  909. FUNCTION {initialize.longest.label}
  910. { "" 'longest.label :=
  911.   #1 'number.label :=
  912.   #0 'longest.label.width :=
  913. }
  914.  
  915. FUNCTION {longest.label.pass}
  916. { number.label int.to.str$ 'label :=
  917.   number.label #1 + 'number.label :=
  918.   label width$ longest.label.width >
  919.     { label 'longest.label :=
  920.       label width$ 'longest.label.width :=
  921.     }
  922.     'skip$
  923.   if$
  924. }
  925.  
  926. EXECUTE {initialize.longest.label}
  927.  
  928. ITERATE {longest.label.pass}
  929.  
  930. FUNCTION {begin.bib}
  931. { preamble$ empty$
  932.     'skip$
  933.     { preamble$ write$ newline$ }
  934.   if$
  935.   "\begin{thebibliography}{"  longest.label  * "}" * write$ newline$
  936. }
  937.  
  938. EXECUTE {begin.bib}
  939.  
  940. EXECUTE {init.state.consts}
  941.  
  942. ITERATE {call.type$}
  943.  
  944. FUNCTION {end.bib}
  945. { newline$
  946.   "\end{thebibliography}" write$ newline$
  947. }
  948.  
  949. EXECUTE {end.bib}
  950.